package homework03;

import java.util.Scanner;	

class Person1{
	private String name;
	private int age;
	private boolean gender;
	private int id;
	static int idnum=0;
	
	static{
		System.out.println("This is static initialization block");
	}
	
	{
		this.id=idnum++;
		System.out.println("This is initialization block, id is "+id);
	}
	

	public Person1()
	{
		System.out.println("This is constructor");
		System.out.printf("%s,%d,%b,%d%n", name,age,gender,id);
	}
	
	public Person1(String name, int age,boolean gender)
	{
		this.name=name;
		this.age=age;
		this.gender=gender;
	}

	
	public String toString() {
		return "Person1 [name=" + name + ", age=" + age + ", gender=" + gender + ", id=" + id + "]";
	}

	
	
}

public class Seven02 {
	public static void main(String[] args)
	{
		Scanner sc=new Scanner(System.in);
		String n=sc.nextLine();
		Person1 pers[]=new Person1[Integer.parseInt(n)];
		for(int i=0;i<Integer.parseInt(n);i++)
		{
			Person1 per=new Person1(sc.next(),sc.nextInt(),sc.nextBoolean());
			pers[i]=per;
		}
		
		for(int i=pers.length-1;i>=0;i--)
		{
			System.out.println(pers[i].toString());
		}
		Person1 per=new Person1();
		System.out.println(per.toString());
		sc.close();
	}
}
